import request from "../utils/request"
//获取栏目列表接口
export function category() {
    return request({
        method: "get",
        url: "/category"
    })
}

//封装新闻列表接口
export function newsList(params) {
    return request({
        method: "get",
        url: "/post",
        params
    })
}

//封装获取文章详情数据接口
export function articleDetail(id) {
    return request({
        method: "get",
        url: "/post/" + id
    })
}

//封装评论列表数据
export function post_comment(id) {
    return request({
        method: "get",
        url: "/post_comment/" + id
    })
}

//封装发布评论列表数据
export function send_comment(id, data) {
    return request({
        url: "/post_comment/" + id,
        method: "post",
        data
    })
}

//点赞文章接口
export function post_like(id) {
    return request({
        method: "get",
        url: "/post_like/" + id
    })
}

//文章收藏接口
export function post_star(id) {
    return request({
        method: "get",
        url: "/post_star/" + id
    })
}

//收藏文章列表
export function user_star() {
    return request({
        method: "get",
        url: "/user_star"
    })
}

//搜索推荐
export function post_search_recommend(params) {
    return request({
        method: "get",
        url: "/post_search_recommend",
        params
    })
}